<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"  %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'categoryInfo.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<script type="text/javascript">
		function getCateList()
		{
		 window.location.href="provide/Pro_getCateList.shtml";
		}
		
	</script>
  </head>
  
  <body >
  <div>
  <!--查询-->
   <s:form action="provide/Pro_selectIf.action" method="post">
      <table border="1" width="100%" cellspacing="0">
         <tr>
           <s:hidden name="category.categoryId" value="%{categoryId}"/>
           <td>种类名称:</td><td><input name="category.categoryName" value="${category.categoryName}" size="6"></td>
           <td>种类描述:</td><td><input name="category.categoryDis" value="${category.categoryDis}" size="4"></td>
           <td><input type="submit" value="查询"></td>
         </tr>
      </table>
   </s:form>
   
  	<table>
  		<tr>
  		<th>种类名称</th>
  		<th>种类描述</th>
  		<th>操作</th>
  		</tr>
  		 <s:iterator value="catelist" id="category" status="category_stat">
  		 
  		  <s:url id="del" action="Pro_delCate" namespace="/provide">
             <s:param name="category.categoryId" value="categoryId"/>
          </s:url>
          <s:url id="update" action="Pro_getCate" namespace="/provide">
             <s:param name="category.categoryId" value="categoryId"/>
          </s:url>
          
  		 <s:if test="null==catelist">没有相关信息</s:if>  
         <tr >
            <td><s:property value="categoryName" /></td>  
            <td><s:property value="categoryDis" /></td>
            <td>
				<a href="${update}">修改</a>&nbsp;<a href="${del}">删除</a>
			</td>  
        </tr>  
     </s:iterator>  
     <tr><td colspan="3">
  		<input type="button" value="添加" onclick="javascript:location.href='provide/category_add.jsp'"/>
  		<input type="button" value="全部信息" onclick="javascript:location.href='provide/Pro_getCateList.shtml'"/>
  	</td></tr>	
  	</table>
  	
  </div>
  </body>
</html>
